<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* .triangle {
            width: 0;
            height: 0;
            border-left: 50px solid transparent;
            border-right: 50px solid transparent;
            border-bottom: 100px solid red;
            /* border-top: 100px solid transparent; */
        /* } */

        /* 向上 */

        /* 用伪元素 */
        .triangle::after {
            content: "";
            position: absolute;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-bottom: 15px solid red;
        }
    </style>
</head>

<body>
    <div class="triangle"></div>

</body>

</html>